<script type="text/javascript" src="/js/account.js" language="javascript" ></script>
<?php 
if(isset($_SESSION['config_template']))
{
	if($_SESSION['config_template']=='layoutmain_web1')
	{
		?>
		<link rel="stylesheet" type="text/css" href="/css/web1/style.css" media="all">
		<div class="my-account">
					
					<h1><?php echo $this->text_pass;?></h1>
					<div class="line"><hr></div>
					<br>
					
							<form id="frmRegister" name="frmRegister" action="#" method="POST" enctype="multipart/form-data" onsubmit="return checkChangePass()">
								<div class="fieldset" style="height:auto !important;width:640px;">
								
									<h2 class="legend"><?php echo $this->text_lgpass;?></h2>
									<ul class="form-list" >
										<li style="width:640px;">
											<label for="current_password" class="required"><em>*</em><?php echo $this->text_currentpass;?></label>
											<div class="input-box">
												<input type="password" title="<?php echo $this->text_currentpass;?>" class="input-text" name="txtPassword" id="txtPassword">
											</div>
											<div class="contact_error" id="alertPassword">
		                                    	<?php if(isset($this->passwordError)) echo $this->error_pass7;?>
		                                    </div>
										</li>
										<li class="fields" >
											<div class="field">
												<label for="password" class="required"><em>*</em><?php echo $this->text_newpass;?></label>
												<div class="input-box">
													<input type="password" title="<?php echo $this->text_newpass;?>" class="input-text" name="txtNewPassword" id="txtNewPassword">
												</div>
												<div class="contact_error" id="alertNewPass">
                                    			</div>
											</div>
											<div class="field">
												<label for="confirmation" class="required"><em>*</em><?php echo $this->text_confirmpass;?></label>
												<div class="input-box">
													<input type="password" title="<?php echo $this->text_confirmpass;?>" class="input-text" name="txtComfirmPassword" id="txtComfirmPassword">
												</div>
												<div class="contact_error" id="alertConfirmPass">
                                    			</div>
											</div>
										</li>
									</ul>
								</div>
								<div class="fieldset" style="height:auto !important;width:640px;">
									<h2 class="legend"><?php echo $this->text_lgcaptcha;?></h2>
									<table width="100%">
									<tbody>
										<tr>
											<td class="label"><p class="labeltxt"><?php echo $this->text_captcha;?></p></td>
											<td></td>
											<td class="txtInput">
												<div style="width:160px; height:50px; float:left;">
		                                    		<a onclick="captcha()" style="cursor:pointer"><img id="captchaShow" src="<?php echo "/captcha/images/".$this->captchaID.".jpg"?>"/></a>
		                                    	</div>
		                                    	<div style="width:28px; height:30px; float:left; margin-top:10px; margin-left:10px;">
		                                    		<input type="button" id="changeCaptcha" name="changeCaptcha" value="" onclick="captcha()" style="background:url(/images/ResetButton.png); width:28px; height:30px; border:0; cursor:pointer"/>
		                                    	</div>
											</td>
											<td class="outputError">
		                                    	<input type="hidden" id="hdnCaptcha" name="hdnCaptcha" value="<?php echo $this->captchaID?>" />
		                                    </td>
										</tr>
										<tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_inputcaptcha;?></p></td>
		                                    <td class="td_star"><span class="star" style="color:red">*</span></td>
		                                    <td class="txtInput">
		                                    	<input type="text" name="txtCaptcha" id="txtCaptcha" maxlength="20" class="input-text" />
		                                    </td>
		                                    <td class="contact_error" id="alertCaptcha">
		                                    	<?php if(isset($this->captchaError)) echo $this->error_pass8;?>
		                                    </td>
		                                </tr>
									</tbody>
									</table>
								</div>
								<div class="buttons-set" style="width:700px;">
									<p class="required"><?php echo $this->text_tip;?></p>
									<p class="back-link"><a href="/account"><small>« </small><?php echo $this->text_cancel;?></a></p>
									<button type="submit" title="<?php echo $this->text_submit;?>" class="button"><span><span><?php echo $this->text_submit;?></span></span></button>
								</div>
						</form>
                    
                </div>
		<?php 
	}
	else 
	{
		if($_SESSION['config_template']=='layoutmain_web2')
		{?>
		
			<!-- start center -->
					<div id="main" class="col-main">
						<div class="my-account">
								<div class="page-title">
									<h1><?php echo $this->text_pass;?></h1>
								</div>
								<form id="frmRegister" name="frmRegister" action="" method="POST" enctype="multipart/form-data" onsubmit="return checkChangePass()">
								<div class="fieldset" style="height:auto !important;width:640px;">
								
									<h2 class="legend"><?php echo $this->text_lgpass;?></h2>
									<ul class="form-list" >
										<li style="width:640px;">
											<label for="current_password" class="required"><em>*</em><?php echo $this->text_currentpass;?></label>
											<div class="input-box">
												<input type="password" title="<?php echo $this->text_currentpass;?>" class="input-text" name="txtPassword" id="txtPassword">
											</div>
											<div class="contact_error" id="alertPassword">
		                                    	<?php if(isset($this->passwordError)) echo $this->error_pass7;?>
		                                    </div>
										</li>
										<li class="fields" >
											<div class="field">
												<label for="password" class="required"><em>*</em><?php echo $this->text_newpass;?></label>
												<div class="input-box">
													<input type="password" title="<?php echo $this->text_newpass;?>" class="input-text" name="txtNewPassword" id="txtNewPassword">
												</div>
												<div class="contact_error" id="alertNewPass">
                                    			</div>
											</div>
											<div class="field">
												<label for="confirmation" class="required"><em>*</em><?php echo $this->text_confirmpass;?></label>
												<div class="input-box">
													<input type="password" title="<?php echo $this->text_confirmpass;?>" class="input-text" name="txtComfirmPassword" id="txtComfirmPassword">
												</div>
												<div class="contact_error" id="alertConfirmPass">
                                    			</div>
											</div>
										</li>
									</ul>
								</div>
								<div class="fieldset" style="height:auto !important;width:640px;">
									<h2 class="legend"><?php echo $this->text_lgcaptcha;?></h2>
									<table width="100%">
									<tbody>
										<tr>
											<td class="label"><p class="labeltxt"><?php echo $this->text_captcha;?></p></td>
											<td></td>
											<td class="txtInput">
												<div style="width:160px; height:50px; float:left;">
		                                    		<a onclick="captcha()" style="cursor:pointer"><img id="captchaShow" src="<?php echo "/captcha/images/".$this->captchaID.".jpg"?>"/></a>
		                                    	</div>
		                                    	<div style="width:28px; height:30px; float:left; margin-top:10px; margin-left:10px;">
		                                    		<input type="button" id="changeCaptcha" name="changeCaptcha" value="" onclick="captcha()" style="background:url(/images/ResetButton.png); width:28px; height:30px; border:0; cursor:pointer"/>
		                                    	</div>
											</td>
											<td class="contact_error">
		                                    	<input type="hidden" id="hdnCaptcha" name="hdnCaptcha" value="<?php echo $this->captchaID?>" />
		                                    </td>
										</tr>
										<tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_inputcaptcha;?></p></td>
		                                    <td class="td_star"><span class="star" style="color:red">*</span></td>
		                                    <td class="txtInput">
		                                    	<input type="text" name="txtCaptcha" id="txtCaptcha" maxlength="20" class="input-text" />
		                                    </td>
		                                    <td class="contact_error" id="alertCaptcha">
		                                    	<?php if(isset($this->captchaError)) echo $this->error_pass8;?>
		                                    </td>
		                                </tr>
									</tbody>
									</table>
								</div>
								<div class="buttons-set" style="width:700px;">
									<p class="required"><?php echo $this->text_tip;?></p>
									<p class="back-link"><a href="/account"><small>« </small><?php echo $this->text_cancel;?></a></p>
									<button type="submit" title="<?php echo $this->text_submit;?>" class="button"><span><span><?php echo $this->text_submit;?></span></span></button>
								</div>
								</form>
							</div>
					</div>
					<!-- end center -->		
		<?php }
		else 
		{?>
<link rel="stylesheet" type="text/css" href="/css/userStyle.css" />
				<p><?php echo $this->text_pass;?></p>
				<div class="line"><hr></div>
				<br />
                <div id="contentUser">
                	<i class="guide"><?php echo $this->text_tip;?></i>
                	<form id="frmRegister" name="frmRegister" action="" method="POST" enctype="multipart/form-data" onsubmit="return checkChangePass()">
                    	<div id="contentUser_1">
                    	<fieldset style="width:650px">
                        	<legend><span class="nameInformation"><b><?php echo $this->text_lgpass;?></b></span></legend>
                            <table width="650px">
                            	<tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_currentpass;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<input type="password" name="txtPassword" id="txtPassword" size="20" maxlength="30" class="input"/>
                                    </td>
                                    <td class="outputError" id="alertPassword">
                                    	<?php if(isset($this->passwordError)) echo $this->error_pass7;?>
                                    </td>
                        		</tr>
                                <tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_newpass;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<input type="password" name="txtNewPassword" id="txtNewPassword" size="20" maxlength="30" class="input"/>
                                    </td>
                                    <td class="outputError" id="alertNewPass">
                                    </td>
                                </tr>
                                <tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_confirmpass;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<input type="password" name="txtComfirmPassword" id="txtComfirmPassword" size="20" maxlength="30" class="input"/>
                                    </td>
                                    <td class="outputError" id="alertConfirmPass">
                                    </td>
                                </tr>
                        	</table>
                        </fieldset>
                        </div><!--end contentUser_1-->
                        <div id="contentUser_3">
                        <fieldset style="width:650px">
                        	<legend><span class="nameInformation"><b><?php echo $this->text_lgcaptcha;?></b></span></legend>
                            <table width="650px">
                            	<tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_captcha;?></p></td>
                                	<td></td>
                                    <td class="txtInput">
                                    	<div style="width:160px; height:50px; float:left;">
                                    		<a onclick="captcha()" style="cursor:pointer"><img id="captchaShow" src="<?php echo "/captcha/images/".$this->captchaID.".jpg"?>"/></a>
                                    	</div>
                                    	<div style="width:28px; height:30px; float:left; margin-top:10px; margin-left:10px;">
                                    		<input type="button" id="changeCaptcha" name="changeCaptcha" value="" onclick="captcha()" style="background:url(/images/ResetButton.png); width:28px; height:30px; border:0; cursor:pointer"/>
                                    	</div>
                                    </td>
                                    <td class="outputError">
                                    	<input type="hidden" id="hdnCaptcha" name="hdnCaptcha" value="<?php echo $this->captchaID?>" />
                                    </td>
                                </tr>
                                <tr>
                        			<td></td><td></td>
                        			<td colspan="2" class="outputTip">
                        				<!-- <ul>
                        					<li>- Hãy nhập lại mã xác nhận vào bên dưới.</li>
                        					<li>- Không phân biệt HOA/thường.</li>
                        				</ul> -->
                        			</td>
                        		</tr>
                                <tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_inputcaptcha;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<input type="text" name="txtCaptcha" id="txtCaptcha" size="20" maxlength="20" class="input" />
                                    </td>
                                    <td class="outputError" id="alertCaptcha">
                                    	<?php if(isset($this->captchaError)) echo $this->error_pass8;?>
                                    </td>
                                </tr>
                            </table>
                        </fieldset>
                        </div><!--end contentUser_3-->
                        <div id="contentUser_4">
                        	<table width="70%">
                        		<tr>
                        			<td width="20%" style="text-align:center">
                            			<input type="submit" value="<?php echo $this->text_submit;?>" class="btnUser" />
                            		</td>
                            		<td width="20%" style="text-align:center">
                            			<a href="/account"><input type="button" value="<?php echo $this->text_cancel;?>" class="btnUser"/></a>
                            		</td>
                            	</tr>
                            </table>
                        </div><!--end contentUser_4-->
                    </form>
                    
                </div><!--end contentUser-->
                    <?php }
	}
}?>
                    <script type="text/javascript">
                    function checkPassword()
                    {
                    	var pass = document.frmRegister.txtPassword.value;
                    	var newpass = document.frmRegister.txtNewPassword.value;
                    	var confirmPass = document.frmRegister.txtComfirmPassword.value;
                    	if(pass=='' || pass==null)
                    	{
                    		document.getElementById("alertPassword").innerHTML="<?php echo $this->error_pass1;?>";
                    		document.frmRegister.txtPassword.focus();
                    		document.getElementById("alertConfirmPass").innerHTML="";
                    		document.getElementById("alertNewPass").innerHTML="";
                    		return false;
                    	}
                    	if(newpass.length<6)
                    	{
                    		document.getElementById("alertNewPass").innerHTML="<?php echo $this->error_pass2;?>";
                    		document.frmRegister.txtNewPassword.focus();
                    		document.getElementById("alertConfirmPass").innerHTML="";
                    		document.getElementById("alertPassword").innerHTML="";
                    		return false;
                    	}
                    	for(var i=0; i<newpass.length; i++)
                    	{
                    		if(newpass.charCodeAt(i)<32 || newpass.charCodeAt(i)>126)
                    		{
                    			document.getElementById("alertNewPass").innerHTML="<?php echo $this->error_pass3;?>";
                    			document.frmRegister.txtNewPassword.focus();
                    			document.getElementById("alertConfirmPass").innerHTML="";
                    			document.getElementById("alertPassword").innerHTML="";
                    			return false;
                    		}
                    	}
                    	if(newpass==pass)
                    	{
                    		document.getElementById("alertNewPass").innerHTML="<?php echo $this->error_pass4;?>";
                    		document.frmRegister.txtNewPassword.focus();
                    		document.getElementById("alertPassword").innerHTML="";
                    		document.getElementById("alertConfirmPass").innerHTML="";
                    		return false;
                    	}
                    	if(newpass!=confirmPass)
                    	{
                    		document.getElementById("alertConfirmPass").innerHTML="<?php echo $this->error_pass5;?>";
                    		document.frmRegister.txtComfirmPassword.focus();
                    		document.getElementById("alertPassword").innerHTML="";
                    		document.getElementById("alertNewPass").innerHTML="";
                    		return false;
                    	}
                    	document.getElementById("alertPassword").innerHTML="";
                    	document.getElementById("alertNewPass").innerHTML="";
                    	document.getElementById("alertConfirmPass").innerHTML="";
                    	return true;
                    }
                    
                    function checkCaptcha()
                    {
                        var captcha = document.frmRegister.txtCaptcha.value;
                    	if(captcha=="" || captcha==null)
                    	{
                    		document.getElementById("alertCaptcha").innerHTML="<?php echo $this->error_pass6;?>";
                    		document.frmRegister.txtCaptcha.focus();
                    		return false;
                    	}
                    	document.getElementById("alertCaptcha").innerHTML="";
                    	return true;
                    }
                    
                    function checkChangePass()
                    {
                    	if(!checkPassword())
                    		return false;
                    	if(!checkCaptcha())
                    	{
                    		return false;
                    	}
                    	return true;
                    }
                    </script>
			<div style="clear: both;"></div>
			